<template>
	<u-popup v-model="showPop" mode="bottom" border-radius="14" :closeable="true" @close="onClose"	:safe-area-inset-bottom="true">
		<view  class="item-list bg-white">
			<u-radio-group v-model="selectedData">
				<view class="item" style="display: flex; flex-direction: column; line-height: 66rpx;">
			    <u-radio v-for="(item, index) in expressList" :key="index" :name="item.name" :active-color="colorConfig.primary">
			        {{item.name}}
			    </u-radio>
				</view>
			</u-radio-group>
		</view>
	</u-popup>
</template>

<script>
	import {
		getExpressList,
	} from '@/api/store';
	
	export default {
		props: {
		},
		data() {
			return {
				selectedData:'',
				read_agreement: '',
				shop: {},
				expressList:[],
				showPop: false
			};
		},
		props: {
			show: {
				type: Boolean,
			},
		},
		computed: {
		},

		watch: {
			show(val) {
				this.showPop = val
			}
		},
		created() {
			console.log('s=========createdpec')
			this.getExpressListFun();
		},
		methods: {
			async getExpressListFun() {
				const {
					code,
					data
				} = await getExpressList({})
				if (code == 1) {
					this.expressList = data.list
				}
			},
			onClose() {
				this.$emit('close')
			},
			onClick(type) {
				let {
					checkedGoods,
					goodsNum
				} = this;
				if (this.specValueText.indexOf('请选择') != -1) return this.$toast({
					title: this.specValueText
				})
				if (checkedGoods.stock == 0) return this.$toast({
					title: '当前选择库存不足'
				})
				checkedGoods.goodsNum = goodsNum;
				this.$emit(type, {
					detail: checkedGoods
				});
			},
			// 查看商品图片
			previewImage(current) {
				uni.previewImage({
					current,
					urls: [current] // 需要预览的图片http链接列表

				});
			},

		}
	};
</script>
<style lang="scss" scoped>
	.item-list{
		margin: 20rpx;
		padding: 20rpx;
	}
	.item{
		display: flex;
		flex-direction: column;
		padding-top: 10rpx;
	}
</style>